import React, { useContext } from 'react'
import { MyContext } from '../../context/index'
const Index = () => {
  const { list } = useContext(MyContext);
  
  return (
    <div>
      {
        list.map((v, i) => {
          return <div className='list-item' key={i}>
            <h3>{i + 1}.{v.title}</h3>
            <div className="desc">类型： {v.typeName}</div>
            <div>{v.typeName}: ¥ {v.price}</div>
          </div>
        })
      }
    </div>  
  )
}

export default Index